package com.lichuandi.springbootdemo1.controller;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import org.springframework.stereotype.Controller;

/**
 * @author Lichuandi
 * @version 1.0
 * @program : springbootdemo1
 * @ClassName UCController
 * @description :
 * @create: 2024-12-25 11:26
 **/
public class UCController extends Application {

    @Override
    public void start(Stage primaryStage) {
        // 创建按钮
        Button btn = new Button();
        btn.setText("Say 'Hello World'");

        // 设置按钮点击事件
        btn.setOnAction(event -> {
            System.out.println("Hello World!");
        });

        // 创建根节点并添加按钮
        StackPane root = new StackPane();
        root.getChildren().add(btn);

        Scene scene = new Scene(root, 300, 250);
        primaryStage.setTitle("Hello World");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
